package com.ruoyi.jksd.service.impl;

import java.math.BigDecimal;
import java.util.List;

import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.jksd.common.dto.XySdDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jksd.mapper.XyGoodsListMapper;
import com.ruoyi.jksd.domain.XyGoodsList;
import com.ruoyi.jksd.service.IXyGoodsListService;

/**
 * 商品管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-26
 */
@Service
public class XyGoodsListServiceImpl implements IXyGoodsListService {
    @Autowired
    private XyGoodsListMapper xyGoodsListMapper;

    /**
     * 查询商品管理
     *
     * @param id 商品管理主键
     * @return 商品管理
     */
    @Override
    public XyGoodsList selectXyGoodsListById(Long id) {
        return xyGoodsListMapper.selectXyGoodsListById(id);
    }

    /**
     * 查询商品管理列表
     *
     * @param xyGoodsList 商品管理
     * @return 商品管理
     */
    @Override
    public List<XyGoodsList> selectXyGoodsListList(XyGoodsList xyGoodsList) {
        return xyGoodsListMapper.selectXyGoodsListList(xyGoodsList);
    }

    /**
     * 新增商品管理
     *
     * @param xyGoodsList 商品管理
     * @return 结果
     */
    @Override
    public int insertXyGoodsList(XyGoodsList xyGoodsList) {
        return xyGoodsListMapper.insertXyGoodsList(xyGoodsList);
    }

    /**
     * 修改商品管理
     *
     * @param xyGoodsList 商品管理
     * @return 结果
     */
    @Override
    public int updateXyGoodsList(XyGoodsList xyGoodsList) {
        return xyGoodsListMapper.updateXyGoodsList(xyGoodsList);
    }

    /**
     * 批量删除商品管理
     *
     * @param ids 需要删除的商品管理主键
     * @return 结果
     */
    @Override
    public int deleteXyGoodsListByIds(Long[] ids) {
        return xyGoodsListMapper.deleteXyGoodsListByIds(ids);
    }

    /**
     * 删除商品管理信息
     *
     * @param id 商品管理主键
     * @return 结果
     */
    @Override
    public int deleteXyGoodsListById(Long id) {
        return xyGoodsListMapper.deleteXyGoodsListById(id);
    }

    @Override
    public XySdDto preOrder(LoginUser loginUser) {


        return null;
    }

    @Override
    public XyGoodsList selectXyGoodsListForDz(Long dzMoney) {
        return xyGoodsListMapper.selectXyGoodsListForDz(dzMoney);
    }

    @Override
    public XyGoodsList selectXyGoodsListForSd(BigDecimal min, BigDecimal nowMoney) {

        return xyGoodsListMapper.selectXyGoodsListForSd(min, nowMoney);
    }

    @Override
    public XyGoodsList selectXyGoodsListForSdrand(BigDecimal minMoney, BigDecimal nowMoney) {
        return xyGoodsListMapper.selectXyGoodsListForSdrand(minMoney.longValue(), nowMoney.longValue());
    }
}
